package com.ruge._01_annotationandconfiguration._01_获取自定义属性的值;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@PropertySource("classpath:ruge.properties")
@ConfigurationProperties(prefix = "ruge")
public class _02_类型安全的获取自定义属性的值 {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @RequestMapping("/config")
    public String index() {

        return name;
    }
}
